package com.yujn.common.bean;

import lombok.Data;

@Data
public class Result<T> {
    private T data;
    private String code;
    private String message;

    public static <T>  Result<T> success(T data){
        Result<T> result = new Result<>();
        result.setData(data);
        result.setCode("success");
        result.setMessage("success");
        return result;
    }

    public static <T>  Result<T> fail(T data,String msg){
        Result<T> result = new Result<>();
        result.setData(data);
        result.setCode("fail");
        result.setMessage(msg);
        return result;
    }

}
